require 'capistrano-db-tasks'

server '47.97.184.255', user: 'root', roles: %w{app web db}

set :pty, false
set :rails_env, 'staging'
set :application, 'pipup'
set :deploy_to, '/var/www/pipup-lms-be-staging'
set :branch, ENV['BRANCH'] || 'dev'
set :keep_releases, 10

append :rvm_map_bins, 'rails'
set :db_local_clean, true

set :puma_bind, %w(tcp://0.0.0.0:3010 unix:///var/www/pipup-lms-be-staging/shared/tmp/sockets/puma.sock)
set :puma_threads, [1,2]
set :puma_workers, 1
set :puma_preload_app, false
set :puma_default_hooks, -> { true }

set :rvm_type, :system
set :rvm_ruby_version, '2.7.2'

# set :sidekiq_monit_conf_dir, -> { '/etc/monit.d' }
set :sidekiq_default_hooks,  -> { true }
set :db_ignore_tables, [:admin_users, :wechat_configs, :toy_codes]
set :db_ignore_data_tables, [:admin_users, :wechat_configs, :toy_codes]